package main

import (
	"fmt"
	"time"

	"go.etcd.io/etcd/client/v3"
)

//启动etcd：./etcd --listen-client-urls 'http://0.0.0.0:2379'  --advertise-client-urls 'http://0.0.0.0:2379'
// localhost为域名对应本机 回环地址ol：127.0.0.1  是虚拟网卡lookback，用来本机内部测试通信，外部无法访问会被丢弃

// 连接etcd
func main() {

	cfg := clientv3.Config{
		Endpoints: []string{"192.168.0.121:2379"},

		DialTimeout: 5 * time.Second,
	}

	_, err := clientv3.New(cfg)
	if err != nil {
		fmt.Println(err)
		return
	}
}
